package com.youlu.campus.entity.card.entity;

import com.youlu.campus.base.base.EntityBase;
import lombok.Getter;
import lombok.Setter;
import lombok.ToString;
import org.springframework.data.annotation.Transient;
import org.springframework.data.mongodb.core.index.CompoundIndex;
import org.springframework.data.mongodb.core.index.CompoundIndexes;
import org.springframework.data.mongodb.core.index.Indexed;
import org.springframework.data.mongodb.core.mapping.Document;

/**
 * @author : [dengbo]
 * @className : CardGoods
 * @description : [卡片商品]
 * @createTime : [2022/12/16 16:00]
 */
@Getter
@Setter
@Document(collection = "card_goods")
@CompoundIndexes({
        @CompoundIndex(name = "first_1_second_1", def = "{'firstCateId':-1,'secondCateId':-1}")
})
@ToString
public class CardGoods extends EntityBase {
    private String firstCateId;
    private String secondCateId;
    /**
     * 商品分类
     */
    private String goodsType;
    /**
     * 商品名称
     */
    private String goodsName;
    /**
     * 三方商品编号
     */
    @Indexed
    private String thirdGoodsCode;
    /**
     * 单位分 成本价
     */
    private Integer price;
    /**
     * 单位分 销售价
     */
    private Integer salePrice;
    /**
     * 单位分 官方价
     */
    private Integer officialPrice;
    /**
     * 优先级排序 越大排在前面
     */
    private Integer priority = 0;
    /**
     * 是否上架
     */
    private Boolean onSale;
    /**
     * 三方商品状态
     */
    private Integer status;
    /**
     * 数量
     */
    private Integer maxQuantity;
    /**
     * 路径
     */
    @Transient
    private String path;
}
